<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@page import="com.easidea.tim.service.saleorder.SaleOrderService"%>
<%@page import="org.springframework.web.context.WebApplicationContext"%>
<%@page import="org.springframework.web.context.support.WebApplicationContextUtils"%>
<%@page import="com.easidea.tim.entity.saleorder.SaleOrder"%>
<%@page import="com.easidea.tim.entity.saleorder.SaleOrderItem"%>
<%@page import="com.easidea.tim.dao.saleorder.SaleOrderItemDao"%>
<%@page import="com.easidea.tim.service.inventory.StorageService"%>
<%@page import="org.hibernate.Session"%>
<%@page import="com.easidea.tim.service.saleorder.SaleOrderItemService"%>
<%
	String orderid = request.getParameter("orderid").toString();
	

	SaleOrderService saleOrderService = new SaleOrderService();
	SaleOrderItemService saleOrderItemService = new SaleOrderItemService();
	StorageService storageService = new StorageService();

	WebApplicationContext wac = WebApplicationContextUtils.getRequiredWebApplicationContext(this.getServletContext());
	List list = ((SaleOrderItemService)wac.getBean("saleOrderItemService")).getItemsById(Long.parseLong(orderid));
	SaleOrderItem item = (SaleOrderItem)list.get(0);

 %>
<?xml version="1.0" encoding="GB2312"?> 
<!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN" "http://www.wapforum.org/DTD/wml_1.1.xml">
<script type="text/javascript">
<!--
	function dosubmit(){
		var meterstring = "";
		for(var i=0;i<<%=item.getPiNum()%>;i++){   
			var j = i.toString() ;                  
			meterstring+=document.getElementById('meternum'+j).value+ ","; 
		}
		document.meterAction.action="com_form.jsp?meterstring="+meterstring+"&orderid="+<%=item.getSaleOrder().getId()%>+"&itemid="+<%=item.getId()%>;
		document.meterAction.submit();
	}
//-->
</script>
<wml>
<card title="订单填充">
	 <table columns="6" align="left">
	  <tr align="left">
	  	 <td>订单编号：<%=item.getSaleOrder().getFlowNo() %></td>
	   </tr>
	   <tr align="left">
	   	<td>客户名称：<%=item.getSaleOrder().getCustomer().getName() %></td>
	   </tr>
	   <tr align="left">
	   	<td>订单时间：<%=item.getCreateTime().toLocaleString() %></td>
	   </tr>
	   <tr align="left">
	   	<td>品名：<%=item.getProductName() %></td>
	   </tr>
	   <tr align="left">
	   	<td>色号：<%=item.getProductColor() %></td>
	   </tr>
	   <tr align="left">
	   	<td>创建人：<%=item.getCreator() %></td>
	   </tr>
	   
	   <form name="meterAction" method="post" action="">
	   <tr align="left">
	   <%
	   		for(int i = 0;i<item.getPiNum();i++){
	    %>
		<td><input type="text" id="meternum<%=i %>"  maxlength="5" width="20"/></td>	
		
		<%
			}
		 %>
	  </tr>
	  <tr>
	  <td><input type="button" value="确定" onclick="dosubmit();"></input></td></tr>
	  </form>

	 </table>
	</card>
	</wml>
 
